/*-------------------------------------------------消息提示层调用----------------------------------------------------------*/
/*
 * 用法： var newTips=new AceonaTips({ tipsClass:"自定义class", strContent:"弹出信息" })
 * newTips.showTips();
 */
// 工厂模式
     function AceonaTips(options){
          this.options = $.extend({
          tipsClass:"app_msg_right",     
          strContent:"提交成功，感谢参与",
          callback:"callback"        
    },options || {});
     }
     AceonaTips.prototype={        
             createTips:function(){
                 if($(this.options.tipsClass)){
                     $("."+this.options.tipsClass).remove();
                 }
                 var createDiv=document.createElement("div");
                 document.getElementsByTagName("body")[0].appendChild(createDiv);
                 $(createDiv).addClass(this.options.tipsClass);
                 $(createDiv).html(this.options.strContent);
                 /*修复ie6下bug*/
                  if(($.browser.msie)&&(parseInt($.browser.version)==6)&&($("select").length>0)){
                         var _tips_x=$(createDiv).innerWidth()+8;
                         var _tips_y=$(createDiv).innerHeight()+8;
                         var ifmStr="<iframe style='width:"+_tips_x+"px;height:"+_tips_y+"px;opacity:0;filter:Alpha(opacity=0);position:absolute;left:-4px;top:-4px' border=0 frameborder=0 framemargin=0 framepadding=0 ></iframe>";
                         $(createDiv).append(ifmStr);
                     }
             },
             showTips:function(){   
               var that=this;
               this.createTips();
               $("."+this.options.tipsClass).eq(0).showMsg({autoMiddle:true,callback:function(){
                   if($.isFunction(that.options.callback)){
                      that.options.callback();
                   }
                  
               }});

             }
         }
/*-------------------------------------------------Ajax loading调用----------------------------------------------------------*/
var Ajax_loading_a=function(containor,loading_text){
    this.loading_text=loading_text;
    this.createDiv=document.createElement("div");
    this.$_contaionr=$(containor);
    this.isCenter=true;
};
Ajax_loading_a.prototype={
    create:function(){
        
         var hasLoading=this.$_contaionr.find('.app_ajax_a');
        
         if(hasLoading){
            this.$_contaionr.find('.app_ajax_a').remove();
         }
        
         $(this.createDiv).addClass("app_ajax_a");
         $(this.createDiv).html(this.loading_text);
         this.$_contaionr.append($(this.createDiv));
         if(this.isCenter){
              $(this.createDiv).css("float","left");
              var _loading_width=$(this.createDiv).outerWidth();
              var _loading_parent_width=$(this.createDiv).parent().outerWidth(false);
               $(this.createDiv).css("float","none");
               var _loading_marginLeft=(_loading_parent_width-_loading_width)*0.5+"px";
               $(this.createDiv).css("margin-left",_loading_marginLeft)
         }
    },
    remove:function(){
        $(this.createDiv).remove();
    }
    
}